<?php

{% include 'header.tpl' %}

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// import Joomla controller library
jimport('joomla.application.component.controller');

/**
 * General Controller of HelloWorld component
 */
class {{ config.component.name|capitalize }}Controller extends JController
{
	/**
	 * display task
	 *
	 * @return void
	 */
	function display($cachable = false) 
	{
		require_once JPATH_COMPONENT.'/helpers/{{ config.component.name|lower}}.php';
		// set default view if not set
		JRequest::setVar('view', JRequest::getCmd('view', '{{ config.component.entities[0].name|capitalize }}list'));

		{{ config.component.name|capitalize }}Helper::addSubmenu(JRequest::getCmd('view', '{{ config.component.entities[0].name|lower }}'));

		// call parent behavior
		parent::display($cachable);
	}
	
}


